package com.crab.framework.spring;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * Created by liusk on 2016/8/10.
 */

@Component
public class SpringContextUtils implements ApplicationContextAware {

    public static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext paramApplicationContext) throws BeansException {
        SpringContextUtils.applicationContext = paramApplicationContext;
    }

    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }
}
